package com.qhs.sys.service;

import com.qhs.sys.constant.TreeView;
import com.qhs.sys.entity.SysRoleInfo;
import com.qhs.sys.vo.MenuVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.ListResourceBundle;

/**
 * 角色管理
 *
 * Created by xinchao on 2016/11/30 0030.
 */
public interface RoleService {

    /**
     * 根据登录账号获取角色信息
     *
     * @param username
     * @return
     */
     List<SysRoleInfo> findRoleListByUserName(String username);

    /**
     * 根据条件查询
     * @param record
     * @return
     */
    List<SysRoleInfo> findRoleByWhere(SysRoleInfo record);

    /**
     * 授权
     * @param ids
     * @param roleId
     * @return
     */
    @Transactional
    int authRole(Long[] ids,Long userId);
    @Transactional
    int authMenu(Long[] ids,Long roleId);
    @Transactional
    int deleteByPrimaryKey(Long roleId);
    @Transactional
    int insert(SysRoleInfo record);
    @Transactional
    int insertSelective(SysRoleInfo record);

    SysRoleInfo selectByPrimaryKey(Long roleId);
    @Transactional
    int updateByPrimaryKeySelective(SysRoleInfo record);
    @Transactional
    int updateByPrimaryKey(SysRoleInfo record);

    List<TreeView> getTreeView(String userName);
    long getRoleId(String code);

    List<String> findRoleListByUserId(Long userId);
}
